<?php
/**
 * @package PHPKit.
 * @author: mawenpei
 * @date: 2016/11/28
 * @time: 15:34
 */
namespace HuoKit\HuoServer\Network;

use RuntimeException;
use swoole_http_server as SwooleHttpServer;
use HuoKit\HuoServer\Network\Http\HttpServer;

class ServerFactory
{
    public static function createHttpServer(array $config)
    {
        $host = $config['host'];
        $port = $config['port'];
        $swooleServer = new SwooleHttpServer($host,$port);
        $server = new HttpServer($swooleServer,$config);
        return $server;
    }
}